<tc_include file="Public:header" />
  <div id="content-container" class="container">
     <if condition="empty($avatar)">
       <div class="alert alert-warning alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <strong>您还没有头像</strong>。拥有一个独有的头像，老师和同学们能更容易关注到你哦～～ <a href="{:u('user/center/pic')}"" class="alert-link" target="_blank">点击设置</a>
	  </div>
	  <else/>
	    <if condition="empty($user['user_nicename'])">
	     <div class="alert alert-warning alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <strong>您还没设置昵称</strong>。请到个人设置里面设置～～ <a href="{:u('user/center/setting')}" class="alert-link" target="_blank">点击设置</a>
         </div>
        </if>
	 </if>
      <div class="row row-3-9">
        <div class="col-md-3">
           <div class="sidenav">
             <ul class="list-group">
             <if condition="$user_type eq 3">
               <li class="list-group-heading" style="margin-top:10px;">我的教学</li>
               <li class="list-group-item"><a href="{:u('teacher/Center/index')}">课程管理</a></li>
               <li class="list-group-item"><a href="{:u('teacher/Center/add')}">课程发布</a></li>
               <li class="list-group-item"><a href="{:u('teacher/Center/sales')}">课程订单</a></li>
             </if>
               <li class="list-group-heading" style="margin-top:10px;">我的学习</li>
               <li class="list-group-item "><a href="{:u('user/center/index')}">我的课程</a></li>
               <li class="list-group-item"><a href="{:u('user/center/jihuo')}">激活课程</a></li>
               <li class="list-group-heading" style="margin-top:10px;">个人设置</li>
               <li class="list-group-item "><a href="{:u('user/center/setting')}"> 基础信息</a></li>
               <li class="list-group-item "><a href="{:u('user/center/pic')}">头像设置</a></li>
               <li class="list-group-item "><a href="{:u('user/center/security')}">修改密码</a></li>          
               <li class="list-group-heading" style="margin-top:10px;">账户中心</li>
               <li class="list-group-item "><a href="{:u('user/center/count')}">我的账户</a></li>
               <li class="list-group-item active"><a href="{:u('user/center/order')}">我的订单</a></li>
               <li class="list-group-item "><a href="{:u('user/center/card')}">点卡充值</a></li>
            </ul>
          </div>
        </div>
        <div class="col-md-9">	
          <div class="panel panel-default panel-col">
	        <div class="panel-heading">我的订单</div>
	           <php>
          		 $status0=$state==0?"class='active'":"";
          		 $status1=$state==1?"class='active'":"";
          		 $status2=$state==2?"class='active'":"";
            	</php>
	          <ul class="nav nav-pills" role="tablist">
               <li role="presentation" {$status0}><a href="{:u('user/center/order' ,array('state'=>0))}">全部订单</a></li>
               <li role="presentation" {$status2}><a href="{:u('user/center/order' ,array('state'=>2))}">待付款<span class="badge">{$num}</span></a></li>
               <li role="presentation" {$status1}><a href="{:u('user/center/order',array('state'=>1))}">已付款</a></li>
             </ul>
          
            <br>   
	         <div class="table-responsive">
               <table class="table table-striped table-hover" id="orders-table">
                <thead>
                 <tr>
                   <th>名称</th>
                   <th>创建时间</th>
                   <th>状态</th>
                   <th>实付(元)</th>
                   <th style="min-width:100px">操作</th>
                 </tr>
                </thead>
                <tbody>
                 <volist name="order" id="vo">  
                  <tr style="word-break: break-all;word-wrap: break-word;">
                     <td><a href="{:u('course/Course/courseinfo',array('id'=>$vo['course_id']))}" target="_blank"><strong>购买课程《{$vo['course_id']|getcoursename}》</strong></a><br>
                       <span class="text-muted text-sm">订单号：{$vo['order']}</span>
                     </td>
                     <td><span class="text-muted text-sm">{$vo['addtime']}</span></td>
                     <if condition="$vo['state'] eq 1">
                       <td><span class="label label-success">已付款</span></td>
                     <else/> 
                       <td><span class="label label-danger">未付款</span></td>
                     </if>
                        <td><span class="money-text">{$vo['total']}.00</span></td>
                     <td>
                     <if condition="$vo['state'] eq 2">
                     <form id="order-create-form" method="post" action="{:u('course/Course/payorder',array('uid'=>$vo['user_id'],'cid'=>$vo['course_id'],'cn'=>$vo['order']))}">
                        <div class="btn-group">
                           <button class="pay-button btn btn-primary"  type="submit">去支付</button>
                        </div>
                     </form>  
                     </if>   
                     </td>
                  </tr>
                 </volist> 
               </tbody>
             </table>
			 <nav class="text-center"><div class="pagination text-center">{$Page}</div></nav>
           </div>
	      </div>
        </div>
     </div>
  </div>
<tc_include file="Public:scripts" />  
<tc_include file="Public:footer" />